package classes;

public class DocPair {
	private String firstName;
	private String secondName;
	int totalWordsFirst;
	int totalWordsSecond;
	int similarWordsCount;
	double similarityrate;
	
	public DocPair(){
		firstName = null;
		secondName = null;
		totalWordsFirst = 0;
		totalWordsSecond = 0;
		similarWordsCount = 0;
	}

	public String getFirstName() {
		return firstName;
	}

	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}

	public String getSecondName() {
		return secondName;
	}

	public void setSecondName(String secondName) {
		this.secondName = secondName;
	}

	public int getTotalWordsFirst() {
		return totalWordsFirst;
	}

	public void setTotalWordsFirst(int totalWordsFirst) {
		this.totalWordsFirst = totalWordsFirst;
	}

	public int getTotalWordsSecond() {
		return totalWordsSecond;
	}

	public void setTotalWordsSecond(int totalWordsSecond) {
		this.totalWordsSecond = totalWordsSecond;
	}

	public int getSimilarWordsCount() {
		return similarWordsCount;
	}

	public void setSimilarWordsCount(int similarWordsCount) {
		this.similarWordsCount = similarWordsCount;
	}
	public void calculateSimilarityRate(){
		if(totalWordsFirst == 0 || totalWordsSecond == 0)
			similarityrate = 0;
		else if(totalWordsFirst > totalWordsSecond){
			similarityrate = (((double)similarWordsCount/(double)totalWordsFirst) * 100.0);
		}
		else{
			similarityrate = (((double)similarWordsCount/(double)totalWordsSecond) * 100.0);
		}
	}
	public double getSimilarityRate(){
		return this.similarityrate;
	}
}